package com.solomon.travel.common.front.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.solomon.travel.common.base.controller.BaseController;
import com.solomon.travel.common.model.ApiResponse;
import com.solomon.travel.common.model.Page;
import com.solomon.travel.common.po.Announce;
import com.solomon.travel.common.service.AnnounceService;
import com.solomon.travel.common.util.ConstantUtils;

@RestController("frontAnnounceController")
@RequestMapping("/front/announce")
public class AnnounceController extends BaseController{
	
	@Resource
	private AnnounceService announceService;
	
	@RequestMapping("/list/type")
	public ApiResponse listByType(Integer type) throws Exception {
		Page page = new Page();
		page.setBeginIndex(0);
		page.setPageSize(6);
		List<Announce> announces = announceService.listByType(null, type, page);
		return new ApiResponse(ConstantUtils.RESPONSE_CODE_OK, announces);
	}
	
	
}
